package com.shujia.day18;

/*
    礼让：
        public static void yield()
 */

class MyThread4 extends Thread{
    @Override
    public void run() {
        for(int i=1;i<=200;i++){
            System.out.println(getName()+"- "+i);
            Thread.yield();
        }
    }
}

public class ThreadDemo4 {
    public static void main(String[] args) {
        MyThread4 t1 = new MyThread4();
        MyThread4 t2 = new MyThread4();

        t1.start();
        t2.start();
    }
}
